package org.foreningsgatan.mercenaries.weather;

import org.foreningsgatan.modular.common.primitive.Interpolation;
import org.foreningsgatan.modular.common.primitive.RandomUtils;

public class WindController {
	private static final int mLength1 = 20;
	private static final int mLength2 = 30;
	
	private final double[] mNoise1;
	private final double[] mNoise2;
	
	public WindController() {
		mNoise1 = RandomUtils.randomDoubles(mLength1);
		mNoise2 = RandomUtils.randomDoubles(mLength2);
	}
	
	public double get(double pIndex) {
		double vInten = 
			Interpolation.getCosine(mNoise1, pIndex / 2) * 0.75 +
			Interpolation.getCosine(mNoise2, pIndex) * 0.25;
		
		return vInten;
	}
}
